﻿/**
 * ...
 * @author aboutwhat
 */

package bloom.io;
import haxe.io.Eof;
import haxe.io.Input;

class InputTools 
{
    /**
     * reads all Input Bytes and returns all
     * lines as one text
     * 
     * @param	i   input to read from
     * @return      all input bytes as text
     */
    public static function getText (i : Input) 
    {
        
        var res = new StringBuf();
        
        while (true) 
        {
            try 
            {
                res.add(i.readLine());
                res.add("\n");
            } 
            catch ( e : Eof) 
            {
                break;
            }
        }
        return res.toString();
    }
}